#pragma once


// CDlgProjSettingsHoopSet dialog

class CDlgProjSettingsHoopSet : public CDialog
{
	DECLARE_DYNAMIC(CDlgProjSettingsHoopSet)
private:
	BOOL m_bHasData ;
	BOOL m_bCancelSel ;
	CString m_strOldVal ;
	int		GetModifyCount(int &nZhuCount,int &nLiangCount);
	BOOL	ReadProjSettings();
	BOOL	ReadDefaultSettings();
 	void	InitCancelInfo(CANCEL_INFO* pNode,int nOpType,LPCTSTR szHint,char* szOldItem,char* szNewItem);
	CRect   m_RtBmp ;
	HBITMAP m_hBitmap		;
	void 	BufferToHBITMAP(HDC hDC, char*pBMPBuffer);
	void	ShowBmp(char *szFile);
	void	ShowEmptyBmp();
public:
	BOOL Read();
	void Clear();
	void	Cancel(CANCEL_INFO* pNode);
	void	Redo(CANCEL_INFO* pNode);
	int		UpdateRecordZhu(long Row, long Col);
	int		UpdateRecordLiang(long Row, long Col);
public:
	CDlgProjSettingsHoopSet(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgProjSettingsHoopSet();

// Dialog Data
	enum { IDD = IDD_Dlg_Proj_Settings_HoopSet };
	CVSFlexGrid	m_VsZhu;
	CVSFlexGrid	m_VsLiang;
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog() ;
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	DECLARE_EVENTSINK_MAP()
	afx_msg void OnClickVsZhu();
	afx_msg void BeforeEditVsZhu(long Row, long Col, BOOL FAR* Cancel);
	afx_msg void OnBeforeSelChangeVsZhu(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel, BOOL FAR* Cancel);
	afx_msg void OnAfterSelChangeVsZhu(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel);
	afx_msg void OnCellChangedVsZhu(long Row, long Col);
	afx_msg void OnClickVsLiang();
	afx_msg void BeforeEditVsLiang(long Row, long Col, BOOL FAR* Cancel);
	afx_msg void OnBeforeSelChangeVsLiang(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel, BOOL FAR* Cancel);
	afx_msg void OnAfterSelChangeVsLiang(long OldRowSel, long OldColSel, long NewRowSel, long NewColSel);
	afx_msg void OnCellChangedVsLiang(long Row, long Col);
	void ComboCloseUpVsZhu(long Row, long Col, BOOL* FinishEdit);
	void ComboCloseUpVsLiang(long Row, long Col, BOOL* FinishEdit);

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBnClickedButtonResume();
	afx_msg void OnBnClickedButtonImport();
	afx_msg void OnBnClickedButtonExport();
	afx_msg void OnBnClickedBtnAdd();
	afx_msg void OnBnClickedBtnDelete();
};
